<template>
  <div>
    <DmbTable
    :columns="columns"
:fetchData="fetchData"
:saveData="saveData"
    />
  </div>
</template>

<script>
// 
import DmbTable  from './myTable.vue'
export default {
components:{  DmbTable},
  data() {
    return {
      columns :[
  { label: '姓名', prop: 'name', type: 'input' },
  { label: '年龄', prop: 'age', type: 'number' },
  { label: '地址', prop: 'address', type: 'input' },
  { label: '职业', prop: 'job', type: 'select', options: [{ label: '教师', value: 'teacher' }, { label: '学生', value: 'student' }] }
],
    };
  },
  methods:{
    fetchData (){
   return  Promise.resolve([
  { name: '张三', age: 25, address: '北京', job: 'teacher' },
  { name: '李四', age: 22, address: '上海', job: 'student' }
])},
saveData (data){
  console.log('保存的数据:', data);
  alert('数据已保存（查看控制台）');
}
  }
}
</script>